/**
*****************************************************************************************
*     Copyright(c) 2019-2020, Realtek Semiconductor Corporation. All rights reserved.
*****************************************************************************************
* @file     mijia_uart.h
* @brief    Head file for mijia uart.
* @details  Data types and external functions declaration.
* @author   hector_huang
* @date     2020-03-05
* @version  v1.0
* *************************************************************************************
*/
#ifndef _MIJIA_UART_H_
#define _MIJIA_UART_H_

#include "platform_types.h"

BEGIN_DECLS

#define MIJIA_UART_DATA_MAX_LEN                     16
#define MI_UART_MSG_NUM                             (512 / MIJIA_UART_DATA_MAX_LEN + 1)

typedef struct
{
    uint8_t data[MIJIA_UART_DATA_MAX_LEN];
    uint8_t len;
} mijia_uart_msg_t;

void mijia_uart_init(uint32_t tx_pin, uint32_t rx_pin, uint8_t evt_type, void *event_queue,
                     void *io_queue);
void mijia_uart_deinit(void);

END_DECLS

#endif /* _MIJIA_UART_H_ */
